package Private.Text_;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class PrivateText{
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException {
        Class<PrivateText1> privateText1Class=PrivateText1.class;
        PrivateText1 privateText1 = privateText1Class.newInstance();
        Field name= privateText1Class.getDeclaredField ("name");
        Method getname=privateText1.getClass().getDeclaredMethod("getname");
        name.setAccessible(true);
        name.set(privateText1,"xxx");
        Object name1=getname.invoke(privateText1);
        System.out.println(name1);
    }
}
